from django.db import models

# Create your models here.

class FaceImage(models.Model):
    class Meta:
        db_table="face-image"
        verbose_name_plural="用户照片"
    fileUrL=models.FileField(verbose_name="image",upload_to="face")


class Users(models.Model):
    class Meta:
        db_table="users"
        verbose_name_plural="用户"

    name=models.CharField(verbose_name="英语名",max_length=20)
    password=models.CharField(verbose_name="密码",max_length=100)
    avata=models.OneToOneField(to=FaceImage,on_delete=models.CASCADE)
    access=models.BooleanField(verbose_name='权限',default=True)


class CatagoryAccess(models.Model):
    class Meta:
        db_table="catagory_access"
        verbose_name_plural="出入方式"
    useFace=models.IntegerField(verbose_name='刷脸',default=0)
    useBtn=models.IntegerField(verbose_name='开关',default=0)
    useApp=models.IntegerField(verbose_name='app',default=0)


class CommunityInfo(models.Model):
    class Meta:
        db_table="CommunityInfo"
        verbose_name_plural="社区公告"

    content=models.TextField(verbose_name="公告",max_length=1000,null=False)